Skip to content

Fix release publish: reconstruct native artifact paths#79

Merged
devcrocod merged 1 commit into
masterfrom
fix/release-native-artifact-staging
Jul 7, 2026
Merged

Fix release publish: reconstruct native artifact paths#79
devcrocod merged 1 commit into
masterfrom
fix/release-native-artifact-staging

Conversation

@devcrocod

Copy link
Copy Markdown
Owner

Problem

The 0.1.0 release publish failed at Copy Android natives to jniLibs:

cp: simdjson-native/build-android-arm64-v8a/libsimdjson_jni.so: No such file or directory

Root cause: the publish job assumed downloaded native artifacts kept their full simdjson-native/build-*/… repo-relative paths. But actions/upload-artifact roots each artifact at the least-common-ancestor of its path entries:

  • multi-file artifacts (native-android, native-kn-ios) lose the simdjson-native/ prefix → keep only build-*/lib;
  • single-file artifacts (all desktop JNI/KN) collapse to a bare filename.

With download-artifact --merge-multiple into the repo root, the Android .sos landed at build-android-*/… (so the cp failed — the observed error), and the JNI/KN libraries collided at the repo root (two libsimdjson_jni.so, two libsimdjson_c.a), invisible to Gradle. Even after fixing Android, Publish would then fail the -Psimdjson.allTargets=true requireAllNatives check for linux-x64/linux-arm64/windows, and the linuxX64 cinterop would miss its static .a.

Fix

Download each artifact into its own directory (path: artifacts, no merge-multiple) and reconstruct the exact tree the publish expects via an explicit stage() helper. Only cross-compiled libraries are staged (linux-x64/linux-arm64/windows JNI, linux-x64 KN .a, both Android ABIs → jniLibs/); host-native libraries (macos-arm64 JNI, macOS/iOS .a) are rebuilt on the runner.

Verification

Simulated the new stage() steps against the real 8 artifacts from the failed run — all 6 required destination paths are reconstructed correctly; YAML validated. The full publishToMavenCentral itself can't be run locally (needs Sonatype/signing secrets), so credential/POM-level issues, if any, would only surface on a real run.

The publish job assumed downloaded native artifacts kept their full
simdjson-native/build-*/ paths, but actions/upload-artifact roots each
artifact at the least-common-ancestor of its paths: the simdjson-native/
prefix is stripped from multi-file artifacts and single-file artifacts
collapse to a bare filename. With download-artifact merge-multiple into
the repo root the Android .so files landed at build-android-*/ (so the
copy step failed with "No such file"), and the JNI/KN libraries collided
at the repo root, invisible to the Gradle publish.

Download each artifact into its own directory and reconstruct the exact
tree the publish expects. Host-native libraries (macos-arm64 JNI,
macOS/iOS Kotlin/Native .a) are rebuilt on the runner, so only the
cross-compiled libraries are staged.
Copilot AI review requested due to automatic review settings July 7, 2026 12:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Maven Central release workflow by avoiding artifact path collisions/flattening from actions/upload-artifact, and explicitly staging downloaded native libraries back into the repository layout that the Gradle publish expects.

Changes:

  • Download all native artifacts into a dedicated artifacts/ directory (no merge into repo root).
  • Add a stage() helper to reconstruct expected repo-relative native library paths before publishing.
  • Stage only cross-compiled natives (Linux/Windows JNI, Linux KN .a, Android .sos), relying on the macOS runner to rebuild host-native outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devcrocod devcrocod merged commit 5a11b85 into master Jul 7, 2026
10 checks passed
@devcrocod devcrocod deleted the fix/release-native-artifact-staging branch July 7, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants